package com.example.chcrm.entity.common;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Author 邹
 * @Date 2025/4/23 0:32
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TArea implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键(区域编码)
     */
    @Excel(name = "区域编码")
    @NotBlank(message = "区域编码不能为空")
    @TableId(value = "id",type = IdType.INPUT)
    private String adCode;

    @NotBlank(message = "父级区域编码不能为空")
    private String parentCode;      //父级区域编码
    private String parentCodeLis;   //多个父级区域编码100000
    @Excel(name = "区域全称")
    private String parentNameLis;   //多个父级区域名字
    @Excel(name = "区域名称")
    @NotBlank(message = "区域名称不能为空")
    private String name;        //行政单位名称
    @Excel(name = "区域类型",replace = {"省_province","市_city","区/县_district"})
    @NotBlank(message = "区域类型不能为空")
    private String level;       //等级  国家 省 市 区/县 province city district
    private String cityCode;    //城市编码
    private String identification;  //标识
    private String center;      //经度，纬度
    private int isDeleted ;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 子节点
     */
    @TableField(exist = false)
    private List<TArea> districts;
    @TableField(exist = false)
    private Integer page = 1;
    @TableField(exist = false)
    private Integer rows = 10;

}
